From 0c80f51189548461b4c4fd5b76933a2a64fae514 Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Thu, 22 Apr 2004 17:51:22 +0000 Subject: [PATCH] bitkeeper revision 1.873 (4088061aJxAcmfxVFNME07oyCEdeaQ) Fix free_irq to not deallocate static irqactions. --- xenolinux-2.4.26-sparse/arch/xen/kernel/ctrl_if.c | 2 ++ xenolinux-2.4.26-sparse/arch/xen/kernel/irq.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/xenolinux-2.4.26-sparse/arch/xen/kernel/ctrl_if.c b/xenolinux-2.4.26-sparse/arch/xen/kernel/ctrl_if.c index d21b0f90b5..7d59ad2e16 100644 --- a/xenolinux-2.4.26-sparse/arch/xen/kernel/ctrl_if.c +++ b/xenolinux-2.4.26-sparse/arch/xen/kernel/ctrl_if.c @@ -294,9 +294,11 @@ void ctrl_if_resume(void) ctrl_if_evtchn = start_info.domain_controller_evtchn; ctrl_if_irq = bind_evtchn_to_irq(ctrl_if_evtchn); +#define SA_STATIC_ACTION 0x01000000 /* so that free_irq() doesn't do kfree() */ memset(&ctrl_if_irq_action, 0, sizeof(ctrl_if_irq_action)); ctrl_if_irq_action.handler = ctrl_if_interrupt; ctrl_if_irq_action.name = "ctrl-if"; + ctrl_if_irq_action.flags = SA_STATIC_ACTION; (void)setup_irq(ctrl_if_irq, &ctrl_if_irq_action); } diff --git a/xenolinux-2.4.26-sparse/arch/xen/kernel/irq.c b/xenolinux-2.4.26-sparse/arch/xen/kernel/irq.c index 07dad7e8ca..8154c5b7c3 100644 --- a/xenolinux-2.4.26-sparse/arch/xen/kernel/irq.c +++ b/xenolinux-2.4.26-sparse/arch/xen/kernel/irq.c @@ -784,7 +784,9 @@ void free_irq(unsigned int irq, void *dev_id) cpu_relax(); } #endif - kfree(action); +#define SA_STATIC_ACTION 0x01000000 /* Is it our duty to free the action? */ + if (!(action->flags & SA_STATIC_ACTION)) + kfree(action); return; } printk("Trying to free free IRQ%d\n",irq); -- 2.30.2